package com.hangzhou.welbeing.welbeinginstrument.view;

import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.MotionEvent;

/**
 * 杭州惟君医疗科技有限公司13
 * Created by 20433 on 2018/1/30
 */

public class CustomViewPager extends ViewPager {
    private boolean isCanScroll = true;
    private boolean noScroll = false;

    public CustomViewPager(Context paramContext)
    {
        super(paramContext);
    }

    public CustomViewPager(Context paramContext, AttributeSet paramAttributeSet)
    {
        super(paramContext, paramAttributeSet);
    }

    public boolean onInterceptTouchEvent(MotionEvent paramMotionEvent)
    {
        return (!this.noScroll) && (this.isCanScroll) && (super.onInterceptTouchEvent(paramMotionEvent));
    }

    public boolean onTouchEvent(MotionEvent paramMotionEvent)
    {
        paramMotionEvent.getAction();
        return (!this.noScroll) && (this.isCanScroll) && (super.onTouchEvent(paramMotionEvent));
    }

    public void scrollTo(int paramInt1, int paramInt2)
    {
        super.scrollTo(paramInt1, paramInt2);
    }

    public void setCurrentItem(int paramInt)
    {
        super.setCurrentItem(paramInt, false);
    }

    public void setCurrentItem(int paramInt, boolean paramBoolean)
    {
        super.setCurrentItem(paramInt, paramBoolean);
    }

    public void setNoScroll(boolean paramBoolean)
    {
        this.noScroll = paramBoolean;
    }

    public void setScanScroll(boolean paramBoolean)
    {
        this.isCanScroll = paramBoolean;
    }
}
